<link href="../../images/style.css" rel="stylesheet" type="text/css">
<?php
require ( "includes/config.php" );
require ( "includes/CGI.php" );
require ( "includes/SQL.php" );

$cgi = new CGI ();
$sql = new SQL ( $DBusername, $DBpassword, $server, $database );

if ( ! $sql->isConnected () )
{
  die ( $DatabaseError );
}

require ( "includes/CSQL.php" ); 
require ( "includes/lang/" . $language_pack . "/index.php" );

?>

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style2 {color: #FFFFFF}
-->
</style>
<form method="get" action="<?php echo "$template_page_name"; ?>">
<input name="op" type="hidden" value="search" />
<table width="233" height="167" border="0" align="center"  cellpadding="2" cellspacing="2">
<?php if($display_search_types == "Y") { ?>
<tr>
<td width="87" height="18"><p><b>Tipo:</b></p></td>
<td width="128"><p>
<select name="pt" size="1" style="height: 18px; width:125px;">
<option value="" selected="selected"><?php echo FORM_SELECT_ALL_TYPES; ?></option>
<?PHP 

    $rows = $sql->execute ( "SELECT * FROM " . $propertytypes_table .
        " ORDER BY propertytype ASC", SQL_RETURN_ASSOC );

    for ( $i = 0; $i < sizeof ( $rows ); ++$i )
    {
      $row = $rows [ $i ];
      
      ?>
<option value="<?php echo $cgi->htmlEncode ( $row [ "id" ] ); ?>">
<?php
      echo $cgi->htmlEncode ( $row [ "propertytype" ] ); ?>
</option>
<?php
    }

?>
</select>
</p></td>
</tr>
<?php }
 if($display_search_max_price == "Y") { 
?>
<tr>
<td class="b2" height="25"><p><b>Menor Valor:</p></td>
<td><p>
<select name="pp_min" style="height: 18px; width:125px;">
<?php if (($display_sale) == "Y"){ ?>
<option value="100"><?php echo CURRENCY; ?> 100,00</option>
<option value="125"><?php echo CURRENCY; ?> 125,00</option>
<option value="150"><?php echo CURRENCY; ?> 150,00</option>
<option value="175"><?php echo CURRENCY; ?> 175,00</option>
<option value="200"><?php echo CURRENCY; ?> 200,00</option>
<option value="300"><?php echo CURRENCY; ?> 300,00</option>
<option value="400"><?php echo CURRENCY; ?> 400,00</option>
<option value="500"><?php echo CURRENCY; ?> 500,00</option>
<option value="600"><?php echo CURRENCY; ?> 600,00</option>
<option value="700"><?php echo CURRENCY; ?> 700,00</option>
<option value="800"><?php echo CURRENCY; ?> 800,00</option>
<option value="900"><?php echo CURRENCY; ?> 900,00</option>
<option value="1000"><?php echo CURRENCY; ?> 1.000,00</option>
<option value="2000" selected="selected"><?php echo CURRENCY; ?> 2.000,00</option>
<?php } if (($display_rental) == "Y"){ ?>
<option value=""><?php echo FORM_DISPLAY_RENTAL_SELECT; ?></option>

<?php } ?>
</select>
</p></td>
</tr>
<tr>
<td height="25"><p ><strong><p>Maior  Valor:</p></strong></p></td>
<td><p>
<select name="pp_max" style="height: 18px; width:125px;">
<?php if (($display_sale) == "Y"){ ?>
<option value="45000" selected="selected"><?php echo CURRENCY; ?> 45.000,00</option>
<option value="65000"><?php echo CURRENCY; ?> 65.000,00</option>
<option value="75000"><?php echo CURRENCY; ?> 75.000,00</option>
<option value="100000"><?php echo CURRENCY; ?> 100.000,00</option>
<option value="125000"><?php echo CURRENCY; ?> 125.000,00</option>
<option value="150000"><?php echo CURRENCY; ?> 150.000,00</option>
<option value="175000"><?php echo CURRENCY; ?> 175.000,00</option>
<option value="200000"><?php echo CURRENCY; ?> 200.000,00</option>
<option value="300000"><?php echo CURRENCY; ?> 300.000,00</option>
<option value="400000"><?php echo CURRENCY; ?> 400.000,00</option>
<option value="500000"><?php echo CURRENCY; ?> 500.000,00</option>
<option value="600000"><?php echo CURRENCY; ?> 600.000,00</option>
<option value="700000"><?php echo CURRENCY; ?> 700.000,00</option>
<option value="800000"><?php echo CURRENCY; ?> 800.000,00</option>
<option value="900000"><?php echo CURRENCY; ?> 900.000,00</option>
<option value="1000000"><?php echo CURRENCY; ?> 1.000,000,00</option>
<option value="2000000"><?php echo CURRENCY; ?> 2.000,000,00</option>
<?php } if (($display_rental) == "Y"){ ?>
<option value=""><?php echo FORM_DISPLAY_RENTAL_SELECT; ?></option>

<?php } ?>
</select>
</p></td>
</tr>
<?php }  if($display_search_bedrooms == "Y") { ?>
<tr>
<td height="25"><p ><strong> <p>Quartos:</p></strong></p></td>
<td><p>
<select name="pb" style="height: 18px; width:125px;">
<option value="0" selected="selected"><?php echo FORM_NO_PREFERENCE; ?></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</p></td>
</tr>
<?php }  if($display_search_locations == "Y") { ?>
<tr>
<td height="25"><p ><strong>Localiza&ccedil;&atilde;o:</strong></p></td>
<td><p>
<select name="pl" size="1" style="height: 18px; width:125px;">
<option value="" selected="selected"><?php echo FORM_NO_PREFERENCE; ?></option>
<?php 

    $rows = $sql->execute ( "SELECT * FROM " .
        $propertylocations_table . " ORDER BY propertylocation ASC",
        SQL_RETURN_ASSOC );

    for ( $i = 0; $i < sizeof ( $rows ); ++$i )
    {
      $row = $rows [ $i ];
      
      ?>
<option value="<?php echo $cgi->htmlEncode ( $row [ "id" ] ); ?>">
<?php
      echo $cgi->htmlEncode ( $row [ "propertylocation" ] ); ?>
</option>
<?php
    }

?>
</select>
</p></td>
</tr>
<?php } ?>
<?php 
if (($display_rental & $display_sale) == "Y"){
echo "<TR><TD><p><input name=\"po\" type=\"radio\" value=\"S\"><font  face=\"Arial\" size=\"2\">Vendas</font><br>
<input name=\"po\" type=\"radio\" value=\"R\"><font face=\"Arial\" size=\"2\">Aluguel</font><br></p></TD></TR>";
}
elseif (($display_rental) == "Y"){
echo "<TR><TD><p>
<input name=\"po\" type=\"hidden\" value=\"R\"></p></TD></TR>";
}
elseif (($display_sale) == "Y"){
echo "<TR><TD></TD><TD><p>
<input name=\"po\" type=\"hidden\" value=\"S\"></p></TD></TR>";
}
?>
<tr>
<td><p>
<input name="" type="image" src="<?php print "$LanguageFolder/$language_pack"; ?>/buttons/button-search.gif" />
</p></td>
</tr>
</table>
<!--
 <?PHP
 if(($display_sale) == "Y") { echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"includes/images/arrow_blue.gif\" width=\"10\" height=\"13\"> <a href=\"$template_page_name?op=search&po=S\">".FORM_VIEW_ALL_SALE_PROPERTIES."</a><br>";} 
 if(($display_rental) == "Y") { echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"includes/images/arrow_blue.gif\" width=\"10\" height=\"13\"> <a href=\"$template_page_name?op=search&po=R\">".FORM_VIEW_ALL_RENT_PROPERTIES."</a>";} 
?>
!-->
 </form>
